import React from "react";
import {
  Form,
  Input,
  Button,
  Dialog,
  TextArea,
  DatePicker,
  Selector,
  Slider,
  Stepper,
  Switch,
} from "antd-mobile";
import style from "./../auth/css/index.module.css";
import { NavBar, Space, Toast } from "antd-mobile";
import { useNavigate } from "react-router-dom";
import { mimaApi } from '../../api/index'
import { useLoaderData } from "react-router-dom";
function Zhu() {
  const nav = useNavigate();
    const gohome = () => {
    localStorage.setItem(
      "token",
      "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OSwidXNlcm5hbWUiOiJ6cyIsInRlbCI6bnVsbCwidGVsQ29kZSI6IjJHUjgiLCJhdmF0YXIiOiJodHRwczovL2FwaS10aWNrZXQubGl1bG9uZ2Jpbi50b3AvaW1hZ2VzL2F2YXRhci5qcGciLCJpYXQiOjE3NDc2MjQ4MzUsImV4cCI6MTc1MDIxNjgzNX0.t95rq42Itxyg8QojalOD3O2xIqVsrnFYK0wBr0AEp6k"
        );
        nav('/home')
}
  return (
    <div>
      <div className={style.op}>
        <NavBar onBack={() => nav(-1)}></NavBar>
        <div className={style.ppt}></div>
      </div>
      <div className={style.login}>
        <span
          style={{ fontSize: "30px", marginLeft: "155px", marginTop: "180px" }}
        >
          登录
        </span>
      </div>
      <div className={style.jn}>
        <Form
          layout="horizontal"
          mode="card"
          footer={
            <Button
              block
              type="submit"
              color="primary"
              size="large"
              onClick={gohome}
            >
              提交
            </Button>
          }
        >
          <Form.Item
            label=""
            name="username"
            rules={[
              {
                required: true,
                message: "请输入电子邮箱",
              },
              {
                pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
                message: "电子邮箱格式不正确",
              },
            ]}
          >
            <Input placeholder="请输入你的电子邮箱" />
          </Form.Item>
          <Form.Item
            label=""
            name=""
            rules={[
              {
                required: true,
                message: "请输入密码",
              },
              // 密码（长度6-15位）
              {
                pattern: /^[\u4e00-\u9fa5a-zA-Z0-9_-]{6,15}$/,
                message: "密码格式不正确",
              },
            ]}
          >
            <Input placeholder="请输入您的密码" />
          </Form.Item>
        </Form>
      </div>
    </div>
  );
}

export default Zhu;
